Business Locations
Please refer to the Authentication document on how to obtain and use an API key.
Available actions & endpoints
Fetching all business-locations
GET /v1/business-locations (Fetch all business locations)
URL Parameters
name type data type description None N/A N/A N/A
Query Parameters
name required data type description businessUuid Yes string The uuid of the business you would like to fetch the business locations for
Responses
http code content-type response 200application/jsonSee example response401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X GET -H "api-key: [YOUR API KEY]" https://api.monitor.insites.com/v1/business-locations?userUuid=[THE userUuid]
Example Response
{
"data": [
{
"uuid": "6b35c1c3-4747-41be-8553-0534863125bf",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"address_line_1": "64 Zoo Lane",
"address_line_2": "",
"address_line_3": "",
"city": "Liverpool",
"county": "Merseyside",
"postcode": "L3 9AG",
"phone_number": "+441332460460",
"created_at": "2022-08-31T13:53:08+00:00",
"updated_at": "2022-08-31T13:53:08+00:00",
"country_code": "GB"
}
],
"meta": {
"per_page": 20,
"from": 1,
"to": 1,
"current_page": 1,
"last_page": 1,
"total": 1,
"next_page_url": null,
"prev_page_url": null,
"first_page_url": "http://localhost:8000/v1/business-locations?page=1",
"last_page_url": "http://localhost:8000/v1/business-locations?page=1"
}
}
Fetching a specific business location
GET /v1/business-locations/[business_location_uuid] (Fetch business location)
URL Parameters
name required data type description business_location_uuid Yes string The uuid of the business location you would like to fetch
Query Parameters
name required data type description None N/A N/A N/A
Responses
http code content-type response 200application/jsonSee example response404application/json{"code":404,"message": "Record not found in table \"business_locations\""}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X GET https://api.monitor.insites.com/v1/business-locations/[business_location_uu]d}
-H "api-key: [YOUR API KEY]"
Example Response
{
"data": {
"uuid": "6b35c1c3-4747-41be-8553-0534863125bf",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"address_line_1": "64 Zoo Lane",
"address_line_2": "",
"address_line_3": "",
"city": "Liverpool",
"county": "Merseyside",
"postcode": "L3 9AG",
"phone_number": "+441332460460",
"created_at": "2022-08-31T13:53:08+00:00",
"updated_at": "2022-08-31T13:53:08+00:00",
"country_code": "GB"
}
}
Creating a business location
POST /v1/business-locations (Create business location)
URL Parameters
name required data type description None N/A N/A N/A
Query Parameters
name required data type description businessUuid Yes string The uuid of the business you would like to create a business location for
Responses
http code content-type response 200application/jsonSee example response422application/json{"success":false,"message":"error","errors":{"address_line_1":{"length":"address_line_1 name must be < 100 characters"}}}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X POST https://api.monitor.insites.com/v1/business-locations
-H "api-key: [YOUR API KEY]"
-H "Content-Type: application/json"
-d "[SEE EXAMPLE REQUEST BODY]"
Example Request Body
{
"address_line_1": "64 Zoo Lane",
"address_line_2": "",
"address_line_3": "",
"city": "Liverpool",
"county": "Merseyside",
"postcode": "L3 9AG",
"phone_number": "+441332460460",
"country_code": "GB"
}
Example Response
{
"message": "success",
"success": true,
"data": {
"uuid": "6b35c1c3-4747-41be-8553-0534863125bf",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"address_line_1": "64 Zoo Lane",
"address_line_2": "",
"address_line_3": "",
"city": "Liverpool",
"county": "Merseyside",
"postcode": "L3 9AG",
"phone_number": "+441332460460",
"created_at": "2022-08-31T13:53:08+00:00",
"updated_at": "2022-08-31T13:53:08+00:00",
"country_code": "GB"
}
}
Updating a business
PATCH /v1/business-locations/[business_location_uuid] (Update business location)
URL Parameters
name required data type description business_location_uuid Yes string The uuid of the business location you would like to update
Query Parameters
name required data type description None N/A N/A N/A
Responses
http code content-type response 200application/jsonSee example response422application/json{"success":false,"message":"error","errors":{"address_line_1":{"length":"address_line_1 must be < 100 characters"}}}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X PATCH https://api.monitor.insites.com/v1/business-locations/[business_location_uu]d}
-H "api-key: [YOUR API KEY]"
-H "Content-Type: application/json"
-d "[SEE EXAMPLE REQUEST BODY]"
Example Request Body
{
"address_line_1": "68 Zoo Lane",
"address_line_2": "",
"address_line_3": "",
"city": "Liverpool",
"county": "Merseyside",
"postcode": "L3 9AG",
"phone_number": "+441332460460",
"country_code": "GB"
}
Example Response
{
"message": "success",
"success": true,
"data": {
"uuid": "6b35c1c3-4747-41be-8553-0534863125bf",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"address_line_1": "68 Zoo Lane",
"address_line_2": "",
"address_line_3": "",
"city": "Liverpool",
"county": "Merseyside",
"postcode": "L3 9AG",
"phone_number": "+441332460460",
"created_at": "2022-08-31T13:53:08+00:00",
"updated_at": "2022-08-31T13:53:08+00:00",
"country_code": "GB"
}
}
Deleting a business
DELETE /v1/business-locations/[business_location_uuid] (Delete business location)
URL Parameters
name required data type description business_location_uuid Yes string The uuid of the business location you would like to delete
Query Parameters
name required data type description None N/A N/A N/A
Responses
http code content-type response 200application/json{"success":true,"message":"success"}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X DELETE https://api.monitor.insites.com/v1/business-locations/[business_location_uu]d}
-H "api-key: [YOUR API KEY]"